home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TTGA10.ARJ
/
HICOLOR.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-19
|
6KB
|
152 lines
/*
* HiColor.H
*
* Copyright 1990,1991 Synergrafix Consulting
* All Rights Reserved.
*
* November 19,1991
*
*/
#ifndef HC_INCLUDE
#define HC_INCLUDE 1
#include <dos.h>
#include <alloc.h>
#include <string.h>
#define HC_SVGALO 0 /* 640x350 */ /* Not all modes supported on all */
#define HC_SVGAMED 1 /* 640x400 */ /* graphics hardware!!! */
#define HC_SVGAHI 2 /* 640x480 */
#define HC_SVGAHI2 3 /* 800x600 */
#define XOR 0
#define OR 1
#define COPY 2
/* TSENG Modes: 0x2D=640x350; 0x2E=640x480; 0x2F=640x400; 0x30=800x600 */
#define FALSE 0
#define TRUE 1
#define SCREENSEG 0xA000
#define GCSEGSEL 0x3CD
#define DAC_MASK 0x3C6 /* DAC pixel mask reg address, also Sierra
command reg address when enabled */
#define DAC_WADDR 0x3C8 /* DAC write address reg address */
typedef unsigned char BYTE;
typedef unsigned int WORD;
typedef unsigned long DWORD;
#define RGB256INT(r,g,b) (WORD)( ( ((r)>>3)<<10 ) | ( ((g)>>3)<<5 ) | ((b)>>3) )
//#define RGB256INT(r,g,b) (WORD)( _rlu[r] | _glu[g] | _blu[b] )
#define RGBINT(r,g,b) (WORD)( ((r)<<10) | ((g)<<5) | (b) )
#define INTRED(c) ((c)>>10)
#define INTGREEN(c) (((c)<<5)>>10)
#define INTBLUE(c) ((c)&31)
#define INTRED256(c) (INTRED(c)<<3)
#define INTGREEN256(c) (INTGREEN(c)<<3)
#define INTBLUE256(c) (INTBLUE(c)<<3)
#define SWAP(a,b) { a^=b; b^=a; a^=b; }
#define BANK(b) { if (b!=hcoldbank) { \
outp(GCSEGSEL, (b<<4)|b); \
hcoldbank=b; \
} \
}
#define DOBANK BANK(*(((WORD *)&hcbitmap)+1));
extern WORD hcoldbank;
extern DWORD hcbitmap;
//extern WORD _rlu[256],_glu[256],_blu[256];
/* HICOLOR.C 19/12/91 10.11.22 */
int hicolorDAC (void);
int tseng4000 (void);
int hcsetmodetseng (int Mode);
int hcmodesize(int picwidth,int picheight);
void hctextmode (void);
void hcputpoint (WORD x, WORD y, WORD color);
void hcputpointxor (WORD x, WORD y, WORD color);
void hcputpointrgb (WORD x, WORD y, WORD r, WORD g, WORD b);
WORD rgb265int (WORD r, WORD g, WORD b);
WORD rgbint (WORD r, WORD g, WORD b);
void intrgb256 (WORD color, WORD *r, WORD *g, WORD *b);
void intrgb (WORD color, WORD *r, WORD *g, WORD *b);
WORD hcgetpoint (WORD x, WORD y);
void hcgetpointrgb (WORD x, WORD y, WORD *r, WORD *g, WORD *b);
WORD hcgetmaxx (void);
WORD hcgetmaxy (void);
void hchline (WORD x, WORD y, WORD x1, register WORD color);
void hcvline (WORD x, WORD y, WORD y1, register WORD color);
void hchlinexor (WORD x, WORD y, WORD x1, register WORD color);
void hcvlinexor (WORD x, WORD y, WORD y1, register WORD color);
void hcrectangle (WORD x, WORD y, WORD x1, WORD y1, WORD color);
void hcrectanglexor (WORD x, WORD y, WORD x1, WORD y1, WORD color);
void hcline(int a1, int b1, int a2, int b2, WORD lcolor);
void hclinexor(int a1, int b1, int a2, int b2, WORD lcolor);
void hccircle(WORD xc,WORD yc,WORD rad,WORD color);
void hcfillcircle(WORD xc,WORD yc,WORD rad,WORD color);
void hcbar (WORD x, WORD y, WORD x1, WORD y1, register WORD color);
void hcclrscr (WORD color);
void hcputrow (WORD x, WORD y, register WORD w, register WORD *buf);
void hcputrowxor (WORD x, WORD y, register WORD w, register WORD *buf);
void hcputrowor (WORD x, WORD y, register WORD w, register WORD *buf);
void hcgetrow (WORD x, WORD y, register WORD w, register WORD *buf);
DWORD hcgetimagesize (register WORD left, register WORD top, register WORD right,register WORD bottom);
void hcgetimage (WORD left, WORD top, WORD right, WORD bottom, WORD *bitmap);
void hcputimage (WORD left, WORD top, WORD *bitmap, WORD drawtype);
void hcputchr (unsigned char ch, WORD xpos, WORD ypos, WORD fg, WORD background);
void hcputstr (char *str, WORD xpos, WORD ypos, WORD fg, WORD background);
void hcfill(int x,int y,int ncolor);
void hcpfill(int x,int y,int bordcol,WORD *pat,int pw,int ph);
WORD *hcimagetopattern(WORD *bitmap,WORD *w,WORD *h);
/* MOUSE.C */
#define GRCURSORSIZEX 11 /* Max. graphics cursor width in pixels */
#define GRCURSORSIZEY 15 /* Max. cursor height in pixels + 1 */
#define GRCURSORNUM 10 /* Max number of default and definable cursors */
#define ARROWCURSOR 0 /* Graphics cursor types */
#define SMALLARROWCURSOR 1
#define CROSSHAIR 2
#define SMALLCROSSHAIR 3
#define DIAGCROSSHAIR 4
typedef int grcursortype[GRCURSORSIZEX][GRCURSORSIZEY];
typedef char mousestr[80];
/* Mouse driver control */
int initmouse(void); /* Init. mouse driver */
void showmouse(void); /* Show (text) cursor */
void hidemouse(void); /* Unshow (text) cursor */
void getmouse(int *x,int *y,int *buttons);/* Get position */
void putmouse(int x,int y); /* Place mouse */
void getmousebuttonon(int button,int *buttonstate,
int *numpresses,int *x,int *y);/* Get buttons pressed */
void getmousebuttonoff(int button,int *buttonstate,
int *numreleases,int *x,int *y);/* Get buttons released */
void setmouserange(int x,int y,int x1,int y1); /* Set range */
void getmousemotion(int *x,int *y); /* Get movement */
void setmousemove(int x,int y); /* Set sensitivity */
/* Mouse cursor routines for BGI Graphics */
void setgrcursor(int index,grcursortype newgrcursor);/* Set cursor bitmap */
void putgrcursor(int x,int y); /* Place graphics cursor */
void unputgrcursor(void); /* Remove graphics cursor */
int getgrcursorx(void); /* Get current postn */
int getgrcursory(void);
int initgrcursor(int grcursorindex,int color);/* Init. graphics cursor */
void closegrcursor(void);
#endif